<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //  利用String对象实现删除字符串前后空格字符。

      var a = new String("           12dd啥的        ");
      a = a.trim();
      console.log(a);
    </script>
  </body>
</html>
